package com.major.dawn.aqs;

import com.major.dawn.aqs.consumer.WaiterNotifyModel;

public class Action {

    public static void main(String[] args) {
        WaiterNotifyModel waiterNotifyModel = new WaiterNotifyModel();

        for (int i = 0; i < 5; i++) {
            Runnable producer = waiterNotifyModel.createProducer();
            Thread thread = new Thread(producer);
            thread.setName("生产者"+i);
            thread.start();
        }

        for (int i = 0; i < 5; i++) {
            Runnable consumer = waiterNotifyModel.createConsumer();
            Thread thread = new Thread(consumer);
            thread.setName("消费者"+i);
            thread.start();
        }


    }
}
